package org.example.alig;

public class Alig2 {
    public static void main(String[] args) {
        int N = 5;
        int datas[][] = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}, {21, 22, 23, 24, 25}};

        // 斜线
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                if (i < j) {
                    int temp = datas[i][j];
                    datas[i][j] = datas[j][i];
                    datas[j][i] = temp;
                }
            }
        }
        // 垂直线
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N / 2; j++) {
                int temp = datas[i][j];
                datas[i][j] = datas[i][N - j - 1];
                datas[i][N - j - 1] = temp;
            }
        }

    }

    private static void extracted(int N, int[][] m) {
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                System.out.printf("%3d", m[i][j]);
            }
            System.out.println();
        }
        System.out.println();
    }

}
